import req from "../utils/http.js"

// 查看个人信息
export function getPersonalInformation() {
    return req.get(`/api/login-user/info`)
}    
// 修改个人信息
export function getModifyInformation(username,email,phonenumber,sex) {
    let parms = new URLSearchParams()
    parms.append("userName", username)
    parms.append("email", email)
    parms.append("phonenumber", phonenumber)
    parms.append("sex", sex)
    return req.post(`/api/system/user/profile/update`,parms)
}
// 退出登录
export function getExitLogin() {
    return req.get(`/api/logout`)
}

// export function getReplacePicture() {
//     return req.post(`/api/system/user/profile/update/avatar/nos`)
// }
export function getModifyAvatar(file) {
    const parms=new FormData()
    parms.append("avatarfile",file)
    return req.post(`/api/system/user/profile/update/avatar/nos`,parms)
}